package com.caiyouxi.partner.controller;

import com.caiyouxi.common.bean.ResData;
import com.caiyouxi.common.service.BaseService;
import com.caiyouxi.partner.model.PartnerBean;
import com.caiyouxi.partner.service.PartnerService;
import com.caiyouxi.partner.service.PartnerServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("partner")
public class PartnerController extends BaseService {
    @Autowired
    private PartnerServices services;
    @Autowired
    private PartnerService service;
    @RequestMapping("delete_partner")
    public ResData delete_partner(@RequestBody PartnerBean bean){
        return services.delete_partner(bean);
    }

    @RequestMapping("insert_selective")
    public ResData insert_selective(@RequestBody PartnerBean bean){
        return services.insert_selective(bean);
    }

    @RequestMapping("update_selective")
    public ResData update_selective(@RequestBody PartnerBean bean){
        return services.update_selective(bean);
    }

    @RequestMapping("select_partner_list")
    public ResData select_partner_list(@RequestBody PartnerBean bean){
        return services.select_partner_list(bean);
    }

    @RequestMapping("get_single_partner")
    public ResData get_single_partner(@RequestBody PartnerBean bean){
        return success(service.get_partner_by_id(bean.getId()));
    }

}
